package com.kiki.stater.consumer;

import java.util.function.Consumer;

/**
 * Created by mazeyi on 2020/12/10.
 */
public class Test {

    public static void main(String[] args) {
        User user = new User("zm");
        //接受一个参数
        Consumer<User> consumer = x -> x.setName("zmChange");
        consumer.accept(user);
        System.out.println(user.getName());
    }
}


class User{

    private String name;

    public User(String name){
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}